const mongoose = require('mongoose')
const Schema = mongoose.Schema

const schema = new Schema({
  name: {
    type: String
  },
  parent: {
    type: Schema.Types.ObjectId,
    ref: 'Category' //关联
  }
})

module.exports = mongoose.model('Category', schema)
